package com.creditcmsplt.util;

public class StringReplaceUtil {




    /**
     * 身份证号，中间10位星号替换
     *
     * @param id 身份证号
     * @return 星号替换的身份证号
     */
    public static String idHide(String id) {
        return id.replaceAll("(\\d{4})\\d{10}(\\d{4})", "$1** **** ****$2");
    }
    
    public static String nameHide(String name) {
    	String startName=name.substring(0, 1);
    	String subStr=name.substring(1, name.length());
    	String abc="**";
        return startName+abc;
    }
    
    public static void main(String[] args) {
    	System.out.println(idHide("430703198910017172"));
    	
    	System.out.println(nameHide("雷阳都是"));
	}

}
